<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ include file="/taglibs.jsp"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath() %>'/>
<c-rt:set var="frontHostName" value='<%=ServerValue.getFrontHostname()%>'/>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<s:url value="/js" var="jsPath"/>
<s:url value="/images" var="imgPath"/>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<script language="javascript">
	$().ready( function() {
		$("#endDateParam").datepick({minDate: new Date(),showOn:'both',numberOfMonths:2, buttonImageOnly: true, buttonImage: '${imgPath}/calendar.gif',dateFormat:"yy-mm-dd"});
	});
</script>
<h1>渠道Template管理<br/>
<div class="f-link">
	<a href="${midContextPath}/channelTemplate/add.do">新增渠道Template</a>
</div>
</h1><br/>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<br/>

<div class="data-form">
	<s:form action="search.do" method="post">
		<b>渠道：</b>
		<s:select name="channelNameParam" list="channelNameMenu.options" listKey="key"  headerKey="" headerValue="全部" listValue="value.name"/>
		<b>结束日期：</b>
		<input name="endDateParam" id="endDateParam" type="text" title="结束日期"  size="10" maxlength="10" value="${endDateParam}" >
	  <b>Template类别：</b>
	  <s:select name="templateTypeParam" list="templateTypeMenu.options" listKey="key" headerKey="" headerValue="全部" listValue="value.name"/>
	  <b>狀態：</b>
	  <s:select name="channelStatusParam" list="channelStatusMenu.options" listKey="key"  listValue="value.name"/>
		<input type="submit" id="searchbtn" value="查询"/>	
	</s:form>
</div>
<br/>

<table class="tb-1" width="100%">
	<thead>
		<tr>
			<th>类别</th>
			<th>渠道</th>
			<th>vm内容</th>
			<th>结束日期</th>
			<th>上下架</th>
			<th>功能</th>
		</tr>
	</thead>
	<tbody>
		<c-rt:forEach items="${templateList}" var="template" varStatus="index">
			<tr>
				<td>${templateTypeMenu.options[template.type].name}</td>
				<td>${template.channelName}</td>
				<td style="text-align: left" width="50%">${fn:escapeXml(template.contents)}</td>
				<td><fmt:formatDate value="${template.endDate}" pattern="yyyy-MM-dd HH:mm" /></td>
				<td>${channelStatusMenu.options[template.channelStatus].name}</td>
				<td><a href="edit.do?id=${template.id}">修改</a></td>
			</tr>
		</c-rt:forEach>
	</tbody>
</table>